<?php
/* @var $this yii\web\View */
use yii\widgets\ActiveForm ;
use yii\helpers\Url ;
$this->params['breadcrumbs'][] = "用户中心";
$this->params['display_name'] = "修改密码" ;
$this->title = '修改密码-' . Yii::$app->params['webname'];
$user_id = Yii::$app->admin->identity->user_id ;
?>
<div class="row">
    <div class="col-md-12">
        <div class="nav-tabs-custom">
            <div class="tab-content">
                <div class="tab-pane active">
                    <div class="box box-success">
                        <div class="box-header with-border text-center">
                          <h3 class="box-title">修改密码</h3>
                        </div><!-- /.box-header -->
                        <?php
                        $form = ActiveForm::begin([
                            'id' => 'permission',
                            'fieldConfig' => ['template' => "{input}{error}",'options'=>['class'=>'col-sm-4']],
                            'options'=>["class"=>"form-horizontal"],
                        ])
                        ?>
                        <div class="box-body">
                            <div class="form-group">
                                <label  class="col-sm-4 control-label">原密码：</label>
                                <?= $form->field($model, 'old_password')->passwordInput(); ?>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">新密码：</label>
                                <?= $form->field($model, 'new_password')->passwordInput(); ?>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">确认密码：</label>
                                <?= $form->field($model, 'confirm_password')->passwordInput(); ?>
                            </div>
                        </div><!-- /.box-body -->
                        <div class="box-footer text-center">
                            <button type="submit" class="btn btn-primary" style="width: 20%;">提交</button>
                        </div><!-- /.box-footer -->
                        <?php ActiveForm::end() ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><!--/span-->
<script>
    var search_query;
    $('.google-secret').click(function () {
        var user_id = $(this).data('id');
        var options = {remote: '<?= Url::toRoute('/google-authenticator/google-secret') ?>' + '?user_id=' + user_id};
        $('#myModal').modal(options)
    });
</script>